<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    /* 第1种 */

    /* .box {
    margin: 100px;
    width: 500px;
    height: 500px;
    border: 1px solid #000;
    position: relative;
  }
  img {
    width: 150px;
    height: 150px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -75px;
    margin-top: -75px;
  } */



    /* 第2种 */
    /* .box {
    width: 500px;
    height: 500px;
    margin: 100px;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  img {
    width: 150px;
    height: 150px;
  } */


    /* 第3种 */
    .box {
        width: 500px;
        margin: 100px;
        height: 500px;
        border: 1px solid #000;
        position: relative;
    }

    img {
        width: 150px;
        height: 150px;
        left: 50%;
        top: 50%;
        position: absolute;
        transform: translate(-50%, -50%);
    }
</style>

<body>
    <div class="box">
        <img src="../img/girl/girl (5).jpg" alt="">
    </div>
</body>

</html>